package com.pro.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author 祖铭泽
 * @Date 2021/11/15/0015
 * @description
 */
@Configuration
public class FileUploadConfig implements WebMvcConfigurer {
    public void addResourceHandler(ResourceHandlerRegistry registry){
        String path = System.getProperty("user.dir") + "/src/main/resources/static/upload";
        registry.addResourceHandler("/static/upload/**").addResourceLocations("file" + path);
    }
}
